package com.youhong.teethcare.utils;

import android.content.Context;

/**
 * Created by Administrator on 2017/5/18.
 */

public class LanguageUtils {


    public static final int L_CHINESE = 0x1;
    public static final int L_ENGLISH = 0x2;
    public static final int L_CZECH = 0x3;
    public static final int L_JAPANESE = 0x4;
    public static final int L_POLISH = 0x5;


    public static final int L_OTHER = 0xFF;

    private Context mContext;

    public LanguageUtils(Context context) {
        mContext = context;
    }

    public int getLanguage() {

        String languages = mContext.getResources().getConfiguration().locale.getLanguage();

        if (languages.endsWith("zh")) {

            return L_CHINESE;

        } else if (languages.endsWith("en")) {

            return L_ENGLISH;

        } else if (languages.endsWith("cs")) {

            return L_CZECH;

        }else if(languages.endsWith("ja")){

            return L_JAPANESE;

        }else if(languages.endsWith("pl")){

            return L_POLISH;

        }

        else {

            return L_OTHER;
        }
    }
}